package cc3002;

public class TamagotchiDigimon extends Tamagotchi {
	protected int level;
	
	private static String evolution = "Mega"; 

	public TamagotchiDigimon(String name) {
		super(name);
		this.level = 1;
	}
	
	@Override
	public void play(){
		assert this.isAlive : " I musn't be a zombie for this";
		level++;
		
		super.play();
		
		viewStatistics();
	}
	
	@Override
	public void viewStatistics(){
		super.viewStatistics();
		
		if(isAlive)
			System.out.println("  level: " + level + "\n");
	}
	
	public void digiEvolves(){
		if((level % 5) == 0){
			name = evolution + name;
			System.out.println("Well done! now my name is " + name + "\n");
		} else {
			System.out.println("it's too soon for digi evolve\n");			
		}
	}
}
